MySQL Connector for Java - How to install in Eclipse and Tomcat 1. Download MySQL Connector: You can easily download MySQL Connector from the official MySQL website, which provides it. Select the Platform Independent option, and download the zip file which contains, among others, the MySQL Connector jar file which will be added in the build path. 2 Install MySQL Connector to your Java application: You need to create a new Java application/Eclipse project in order to install and use the connector. Open Eclipse and create a new project (it does not really matter what kind, as long as you need to use a database). You can add the connector to the build path, by right-clicking on the project -> Build Path -> Configure Build Path -> Libraries -> Add External Jars -> find mysql-connector-java-bin.....jar 3. Start the MySQL service from the WAMP or XAMPP, use one or the other. 4. Create a Database object called, "WebClass." To create the table inside of the database: CREATE TABLE MyGuests ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP ) To populate the table: INSERT INTO MyGuests (firstname, lastname, email) VALUES ('John', 'Doe', 'john@example.com'); INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Barbara', 'Hecker', 'bhecker@acm.org'); INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Jane', 'Doe', 'jane@example.com'); 5. Create the following class object - ordinary java class. import java.sql.*; public class mySQLTest { public static void main(String[] args) throws Exception { System.out.println("I'm running"); Class.forName("com.mysql.jdbc.Driver"); //load the JDBC driver class Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/WebClass","root",""); PreparedStatement statement = con.prepareStatement("Select * from MyGuests"); /*sql structure to select instances from the table*/ ResultSet result = statement.executeQuery(); /*execution of the database query*/ while(result.next()){ System.out.println(result.getString(1) +"\t"+ result.getString(2)+ "\t" + result.getString(3)+ "\t" + result.getString(4) + "\t" + result.getString(5)); /*print the result with the attributes from the table */ } } } 6. The console output should look like: I'm running 1 John Doe john@example.com 2018-06-26 19:53:14.0 2 Barbara Hecker bhecker@acm.org 2018-06-26 19:53:14.0 3 Jane Doe jane@example.com 2018-06-26 19:53:14.0